﻿package client;

import java.awt.BorderLayout;

import java.awt.FlowLayout;

import java.awt.*;
import javax.swing.*;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JLabel;

import java.awt.Color;
import java.awt.Font;

import java.net.MalformedURLException;
import java.rmi.*;
import java.rmi.server.*;
import server.LocationInterface;
import server.Location;
import server.SubwayInterface;
import server.Subway;

import client.Configuration;
import java.awt.Toolkit;


public class SubName extends JDialog {

	private final JPanel contentPanel = new JPanel();
	private String a;
	private double b;
	private boolean c;
	private int d;
	private String e;
	

	/**
	 * Launch the application.
	 */
	/*public static void main(String[] args) {
		try {
			SubName dialog = new SubName();
			dialog.setLocationRelativeTo(null);
			dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
			dialog.setVisible(true);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}*/

	/**
	 * Create the dialog.
	 */
	public SubName(){
		setBounds(100, 100, 664, 400);
		getContentPane().setLayout(new BorderLayout());
		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		getContentPane().add(contentPanel, BorderLayout.CENTER);
		contentPanel.setLayout(null);
		
		
		
	    
		final Person per = new Person();//final?
		
		//JPanel panel = new JPanel();	
		//panel.setBackground(Color.WHITE);
		
		//panel.setLayout(null);
		//panel.setBounds(0, 0, 580, 350);
		//contentPanel.add(panel);
		
		
		
		
		
        final LocationButton button_com = new LocationButton("社区",0);
        if( per.getCurrentLocationNum() == button_com.getButtonNum())
	    	button_com.setEnabled(false);  
        else{
            button_com.addActionListener(new ActionListener() {
		        public void actionPerformed(ActionEvent e) {
		        //if( per.getCurrentLocationNum() == button_com.getButtonNum())
			    	//button_com.setEnabled(false);   
		       // else{						    				    
			        try{
				    	a = button_com.getButtonName();
				    	d = button_com.getButtonNum();
				        Configuration config=new Configuration();
					    String rmiAddress=config.getRmiAddress();
					    LocationInterface startingLocationNum = (LocationInterface) Naming.lookup(rmiAddress+"Location");
					    //startingLocationNum.getStationNum( per.getCurrentLocationNum());
					    LocationInterface endLocationNum = (LocationInterface) Naming.lookup(rmiAddress+"Location");
					    //endLocationNum.getStationNum(button_com.getButtonNum() );
					    SubwayInterface sub = (SubwayInterface) Naming.lookup(rmiAddress+"Subway");
					    //sub.distance(per.getPID(), startingLocationNum.getStationNum(per.getCurrentLocationNum()), endLocationNum.getStationNum(button_com.getButtonNum() ));
			            b = sub.ticketPrice( startingLocationNum.getStationNum(per.getCurrentLocationNum()), endLocationNum.getStationNum(button_com.getButtonNum() ));
			            c = sub.checkOut(per.getPID(), startingLocationNum.getStationNum(per.getCurrentLocationNum()), endLocationNum.getStationNum(button_com.getButtonNum() ));				  				    				    
				    }catch(RemoteException e4){
				    	e4.printStackTrace();
				    } catch (MalformedURLException e5) {
				    	// TODO Auto-generated catch block
				    	e5.printStackTrace();
				    } catch (NotBoundException e6) {
				    	// TODO Auto-generated catch block
				    	e6.printStackTrace();
				    }		
				    SubTicket subTicket=new SubTicket(a,b,c,d);
				    subTicket.setLocationRelativeTo(null);
			    	subTicket.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
			    	subTicket.setVisible(true);
				    dispose();
				}
            });
		}
		button_com.setBounds(22, 169, 69, 23);
		contentPanel.add(button_com);
			
		final LocationButton button_res = new LocationButton("餐厅",1);
		if( per.getCurrentLocationNum() == button_res.getButtonNum())
	    	button_res.setEnabled(false);   
		else{
		    button_res.addActionListener(new ActionListener() {
			    public void actionPerformed(ActionEvent e) {
			    	
				    //杩斿洖绔欏悕缁欐湇鍔＄鍜宑urrent缁欐湇鍔″櫒
				    try{
				    	a = button_res.getButtonName();
				    	d = button_res.getButtonNum();
				        Configuration config=new Configuration();
					    String rmiAddress=config.getRmiAddress();
					    LocationInterface startingLocationNum = (LocationInterface) Naming.lookup(rmiAddress+"Location");
					    //startingLocationNum.getStationNum( per.getCurrentLocationNum());
					    LocationInterface endLocationNum = (LocationInterface) Naming.lookup(rmiAddress+"Location");
					    //endLocationNum.getStationNum(button_res.getButtonNum() );
					    SubwayInterface sub = (SubwayInterface) Naming.lookup(rmiAddress+"Subway");
					    //sub.distance(per.getPID(), startingLocationNum.getStationNum(per.getCurrentLocationNum()), endLocationNum.getStationNum(button_res.getButtonNum() ));
			            b = sub.ticketPrice(startingLocationNum.getStationNum(per.getCurrentLocationNum()), endLocationNum.getStationNum(button_res.getButtonNum() ));
			            c = sub.checkOut(per.getPID(), startingLocationNum.getStationNum(per.getCurrentLocationNum()), endLocationNum.getStationNum(button_res.getButtonNum() ));				  				    				    
				    }catch(RemoteException e4){
				    	e4.printStackTrace();
				    } catch (MalformedURLException e5) {
				    	// TODO Auto-generated catch block
				    	e5.printStackTrace();
				    } catch (NotBoundException e6) {
				    	// TODO Auto-generated catch block
				    	e6.printStackTrace();
				    }		
				    SubTicket subTicket=new SubTicket(a,b,c,d);
				    subTicket.setLocationRelativeTo(null);
			    	subTicket.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
			    	subTicket.setVisible(true);
				    dispose();
			    }
		    });
		}
		button_res.setBounds(148, 284, 69, 23);
		contentPanel.add(button_res);
			
		final LocationButton button_bank = new LocationButton("银行",2);
		if( per.getCurrentLocationNum() == button_bank.getButtonNum())
	    	button_bank.setEnabled(false);   
		else{
		    button_bank.addActionListener(new ActionListener() {
			    public void actionPerformed(ActionEvent e) {
			    	
				    //杩斿洖绔欏悕缁欐湇鍔＄
				    try{
				    	a = button_bank.getButtonName();
				    	d = button_bank.getButtonNum();
				        Configuration config=new Configuration();
					    String rmiAddress=config.getRmiAddress();
					    LocationInterface startingLocationNum = (LocationInterface) Naming.lookup(rmiAddress+"Location");
					    //startingLocationNum.getStationNum( per.getCurrentLocationNum());
					    LocationInterface endLocationNum = (LocationInterface) Naming.lookup(rmiAddress+"Location");
					    //endLocationNum.getStationNum(button_bank.getButtonNum() );
					    SubwayInterface sub = (SubwayInterface) Naming.lookup(rmiAddress+"Subway");
					    //sub.distance(startingLocationNum.getStationNum(per.getCurrentLocationNum()), endLocationNum.getStationNum(button_bank.getButtonNum() ));
			            b = sub.ticketPrice(startingLocationNum.getStationNum(per.getCurrentLocationNum()), endLocationNum.getStationNum(button_bank.getButtonNum() ));
			            c = sub.checkOut(per.getPID(), startingLocationNum.getStationNum(per.getCurrentLocationNum()), endLocationNum.getStationNum(button_bank.getButtonNum() ));				  				    				    
				    }catch(RemoteException e4){
				    	e4.printStackTrace();
				    } catch (MalformedURLException e5) {
				    	// TODO Auto-generated catch block
				    	e5.printStackTrace();
				    } catch (NotBoundException e6) {
				    	// TODO Auto-generated catch block
				    	e6.printStackTrace();
				    }		
				    SubTicket subTicket=new SubTicket(a,b,c,d);
				    subTicket.setLocationRelativeTo(null);
			    	subTicket.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
			    	subTicket.setVisible(true);
				    dispose();
			    }
		    });
		}
		button_bank.setBounds(148, 169, 69, 23);
		contentPanel.add(button_bank);
		
		final LocationButton button_ent = new LocationButton("娱乐城",3);
		if( per.getCurrentLocationNum() == button_ent.getButtonNum())
	    	button_ent.setEnabled(false);   
		else{
		    button_ent.addActionListener(new ActionListener() {
			    public void actionPerformed(ActionEvent e) {
			    	
				    //杩斿洖绔欏悕缁欐湇鍔＄
				    try{
				    	a = button_ent.getButtonName();
				    	d = button_ent.getButtonNum();
				        Configuration config=new Configuration();
					    String rmiAddress=config.getRmiAddress();
					    LocationInterface startingLocationNum = (LocationInterface) Naming.lookup(rmiAddress+"Location");
					    //startingLocationNum.getStationNum( per.getCurrentLocationNum());
					    LocationInterface endLocationNum = (LocationInterface) Naming.lookup(rmiAddress+"Location");
					    //endLocationNum.getStationNum(button_ent.getButtonNum() );
					    SubwayInterface sub = (SubwayInterface) Naming.lookup(rmiAddress+"Subway");
					    //sub.distance(per.getPID(), startingLocationNum.getStationNum(per.getCurrentLocationNum()), endLocationNum.getStationNum(button_ent.getButtonNum() ));
			            b = sub.ticketPrice(startingLocationNum.getStationNum(per.getCurrentLocationNum()), endLocationNum.getStationNum(button_ent.getButtonNum() ));
			            c = sub.checkOut(per.getPID(), startingLocationNum.getStationNum(per.getCurrentLocationNum()), endLocationNum.getStationNum(button_ent.getButtonNum() ));				  				    				    
				    }catch(RemoteException e4){
				    	e4.printStackTrace();
				    } catch (MalformedURLException e5) {
				    	// TODO Auto-generated catch block
				    	e5.printStackTrace();
				    } catch (NotBoundException e6) {
				    	// TODO Auto-generated catch block
				    	e6.printStackTrace();
				    }		
				    SubTicket subTicket=new SubTicket(a,b,c,d);
				    subTicket.setLocationRelativeTo(null);
			    	subTicket.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
			    	subTicket.setVisible(true);
				    dispose();
			    }
		    });
		}
		button_ent.setBounds(516, 264, 94, 23);
		contentPanel.add(button_ent);
		
		final LocationButton button_4 = new LocationButton("销售公司1",4);
		if( per.getCurrentLocationNum() == button_4.getButtonNum())
	    	button_4.setEnabled(false);   
		else{
		    button_4.addActionListener(new ActionListener() {
			    public void actionPerformed(ActionEvent e) {
			    	
				    //杩斿洖绔欏悕缁欐湇鍔＄
				    try{
				    	a = button_4.getButtonName();
				    	d = button_4.getButtonNum();
				        Configuration config=new Configuration();
					    String rmiAddress=config.getRmiAddress();
					    LocationInterface startingLocationNum = (LocationInterface) Naming.lookup(rmiAddress+"Location");
					    //startingLocationNum.getStationNum( per.getCurrentLocationNum());
					    LocationInterface endLocationNum = (LocationInterface) Naming.lookup(rmiAddress+"Location");
					    //endLocationNum.getStationNum(button_4.getButtonNum() );
					    SubwayInterface sub = (SubwayInterface) Naming.lookup(rmiAddress+"Subway");
					    //sub.distance(per.getPID(), startingLocationNum.getStationNum(per.getCurrentLocationNum()), endLocationNum.getStationNum(button_4.getButtonNum() ));
			            b = sub.ticketPrice( startingLocationNum.getStationNum(per.getCurrentLocationNum()), endLocationNum.getStationNum(button_4.getButtonNum() ));
			            c = sub.checkOut(per.getPID(), startingLocationNum.getStationNum(per.getCurrentLocationNum()), endLocationNum.getStationNum(button_4.getButtonNum() ));				  				    				    
				    }catch(RemoteException e4){
				    	e4.printStackTrace();
				    } catch (MalformedURLException e5) {
				    	// TODO Auto-generated catch block
				    	e5.printStackTrace();
				    } catch (NotBoundException e6) {
				    	// TODO Auto-generated catch block
				    	e6.printStackTrace();
				    }		
				    SubTicket subTicket=new SubTicket(a,b,c,d);
				    subTicket.setLocationRelativeTo(null);
			    	subTicket.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
			    	subTicket.setVisible(true);
				    dispose();
			    }
		    });
		}
		button_4.setBounds(249, 169, 94, 23);
		contentPanel.add(button_4);
		
		final LocationButton button_5 = new LocationButton("销售公司2",5);
		if( per.getCurrentLocationNum() == button_5.getButtonNum())
	    	button_5.setEnabled(false);   
		else{
		    button_5.addActionListener(new ActionListener() {
			    public void actionPerformed(ActionEvent e) {
			    	
				//杩斿洖绔欏悕缁欐湇鍔＄
				    try{
				    	a = button_5.getButtonName();
				    	d = button_5.getButtonNum();
				        Configuration config=new Configuration();
					    String rmiAddress=config.getRmiAddress();
					    LocationInterface startingLocationNum = (LocationInterface) Naming.lookup(rmiAddress+"Location");
					    //startingLocationNum.getStationNum( per.getCurrentLocationNum());
					    LocationInterface endLocationNum = (LocationInterface) Naming.lookup(rmiAddress+"Location");
					    //endLocationNum.getStationNum(button_5.getButtonNum() );
					    SubwayInterface sub = (SubwayInterface) Naming.lookup(rmiAddress+"Subway");
					    //sub.distance(per.getPID(), startingLocationNum.getStationNum(per.getCurrentLocationNum()), endLocationNum.getStationNum(button_5.getButtonNum() ));
			            b = sub.ticketPrice(startingLocationNum.getStationNum(per.getCurrentLocationNum()), endLocationNum.getStationNum(button_5.getButtonNum() ));
			            c = sub.checkOut(per.getPID(), startingLocationNum.getStationNum(per.getCurrentLocationNum()), endLocationNum.getStationNum(button_5.getButtonNum() ));				  				    				    
				    }catch(RemoteException e4){
				    	e4.printStackTrace();
				    } catch (MalformedURLException e5) {
				    	// TODO Auto-generated catch block
				    	e5.printStackTrace();
				    } catch (NotBoundException e6) {
				    	// TODO Auto-generated catch block
				    	e6.printStackTrace();
				    }		
				    SubTicket subTicket=new SubTicket(a,b,c,d);
				    subTicket.setLocationRelativeTo(null);
			    	subTicket.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
			    	subTicket.setVisible(true);
				    dispose();
			    }
		    });
		}
		button_5.setBounds(372, 169, 94, 23);
		contentPanel.add(button_5);
		
		final LocationButton button_6 = new LocationButton("投资公司1",6);
		if( per.getCurrentLocationNum() == button_6.getButtonNum())
	    	button_6.setEnabled(false);   
		else{
		    button_6.addActionListener(new ActionListener() {
			    public void actionPerformed(ActionEvent e) {
			    	
				//杩斿洖绔欏悕缁欐湇鍔＄
				    try{
				    	a = button_6.getButtonName();
				    	d = button_6.getButtonNum();
				        Configuration config=new Configuration();
					    String rmiAddress=config.getRmiAddress();
					    LocationInterface startingLocationNum = (LocationInterface) Naming.lookup(rmiAddress+"Location");
					    //startingLocationNum.getStationNum( per.getCurrentLocationNum());
					    LocationInterface endLocationNum = (LocationInterface) Naming.lookup(rmiAddress+"Location");
					    //endLocationNum.getStationNum(button_6.getButtonNum() );
					    SubwayInterface sub = (SubwayInterface) Naming.lookup(rmiAddress+"Subway");
					    //sub.distance(per.getPID(), startingLocationNum.getStationNum(per.getCurrentLocationNum()), endLocationNum.getStationNum(button_6.getButtonNum() ));
			            b = sub.ticketPrice(startingLocationNum.getStationNum(per.getCurrentLocationNum()), endLocationNum.getStationNum(button_6.getButtonNum() ));
			            c = sub.checkOut(per.getPID(), startingLocationNum.getStationNum(per.getCurrentLocationNum()), endLocationNum.getStationNum(button_6.getButtonNum() ));				  				    				    
				    }catch(RemoteException e4){
				    	e4.printStackTrace();
				    } catch (MalformedURLException e5) {
				    	// TODO Auto-generated catch block
				    	e5.printStackTrace();
				    } catch (NotBoundException e6) {
				    	// TODO Auto-generated catch block
				    	e6.printStackTrace();
				    }		
				    SubTicket subTicket=new SubTicket(a,b,c,d);
				    subTicket.setLocationRelativeTo(null);
			    	subTicket.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
			    	subTicket.setVisible(true);
				    dispose();
			    }
		    });
		}
		button_6.setBounds(498, 169, 94, 23);
		contentPanel.add(button_6);
	
		final LocationButton button_7 = new LocationButton("投资公司2",7);
		if( per.getCurrentLocationNum() == button_7.getButtonNum())
	    	button_7.setEnabled(false);   
		else{
		    button_7.addActionListener(new ActionListener() {
			    public void actionPerformed(ActionEvent e) {
			    	
				//杩斿洖绔欏悕缁欐湇鍔＄
				    try{
				    	a = button_7.getButtonName();
				    	d = button_7.getButtonNum();
				        Configuration config=new Configuration();
					    String rmiAddress=config.getRmiAddress();
					    LocationInterface startingLocationNum = (LocationInterface) Naming.lookup(rmiAddress+"Location");
					    //startingLocationNum.getStationNum( per.getCurrentLocationNum());
					    LocationInterface endLocationNum = (LocationInterface) Naming.lookup(rmiAddress+"Location");
					    //endLocationNum.getStationNum(button_7.getButtonNum() );
					    SubwayInterface sub = (SubwayInterface) Naming.lookup(rmiAddress+"Subway");
					    //sub.distance(per.getPID(), startingLocationNum.getStationNum(per.getCurrentLocationNum()), endLocationNum.getStationNum(button_7.getButtonNum() ));
			            b = sub.ticketPrice(startingLocationNum.getStationNum(per.getCurrentLocationNum()), endLocationNum.getStationNum(button_7.getButtonNum() ));
			            c = sub.checkOut(per.getPID(), startingLocationNum.getStationNum(per.getCurrentLocationNum()), endLocationNum.getStationNum(button_7.getButtonNum() ));				  				    				    
				    }catch(RemoteException e4){
				    	e4.printStackTrace();
				    } catch (MalformedURLException e5) {
				    	// TODO Auto-generated catch block
				    	e5.printStackTrace();
				    } catch (NotBoundException e6) {
				    	// TODO Auto-generated catch block
				    	e6.printStackTrace();
				    }	
				    SubTicket subTicket=new SubTicket(a,b,c,d);
				    subTicket.setLocationRelativeTo(null);
			    	subTicket.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
			    	subTicket.setVisible(true);
				    dispose();
			    }
		    });
		}
		button_7.setBounds(303, 71, 94, 23);
		contentPanel.add(button_7);
		
			
		final LocationButton button_8 = new LocationButton("开发公司1",8);
		if( per.getCurrentLocationNum() == button_8.getButtonNum())
	    	button_8.setEnabled(false);   
		else{
		    button_8.addActionListener(new ActionListener() {
			    public void actionPerformed(ActionEvent e) {
			    	
				//杩斿洖绔欏悕缁欐湇鍔＄
				    try{
				    	a = button_8.getButtonName();
				    	d = button_8.getButtonNum();
				        Configuration config=new Configuration();
					    String rmiAddress=config.getRmiAddress();
					    LocationInterface startingLocationNum = (LocationInterface) Naming.lookup(rmiAddress+"Location");
					    //startingLocationNum.getStationNum( per.getCurrentLocationNum());
					    LocationInterface endLocationNum = (LocationInterface) Naming.lookup(rmiAddress+"Location");
					    //endLocationNum.getStationNum(button_8.getButtonNum() );
					    SubwayInterface sub = (SubwayInterface) Naming.lookup(rmiAddress+"Subway");
					    //sub.distance(startingLocationNum.getStationNum(per.getCurrentLocationNum()), endLocationNum.getStationNum(button_8.getButtonNum() ));
			            b = sub.ticketPrice(startingLocationNum.getStationNum(per.getCurrentLocationNum()), endLocationNum.getStationNum(button_8.getButtonNum() ));
			            c = sub.checkOut(per.getPID(), startingLocationNum.getStationNum(per.getCurrentLocationNum()), endLocationNum.getStationNum(button_8.getButtonNum() ));				  				    				    
				    }catch(RemoteException e4){
				    	e4.printStackTrace();
				    } catch (MalformedURLException e5) {
				    	// TODO Auto-generated catch block
				    	e5.printStackTrace();
				    } catch (NotBoundException e6) {
				    	// TODO Auto-generated catch block
				    	e6.printStackTrace();
				    }		
				    SubTicket subTicket=new SubTicket(a,b,c,d);
				    subTicket.setLocationRelativeTo(null);
			    	subTicket.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
			    	subTicket.setVisible(true);
				    dispose();
			    }
		    });
		}
		button_8.setBounds(498, 56, 94, 23);
		contentPanel.add(button_8);
		
		final LocationButton button_9 = new LocationButton("开发公司2",9);
		if( per.getCurrentLocationNum() == button_9.getButtonNum())
	    	button_9.setEnabled(false);   
		else{
		    button_9.addActionListener(new ActionListener() {
			    public void actionPerformed(ActionEvent e) {
			    	
				//杩斿洖绔欏悕缁欐湇鍔＄
				    try{
				    	a = button_9.getButtonName();
				    	d = button_9.getButtonNum();
				        Configuration config=new Configuration();
					    String rmiAddress=config.getRmiAddress();
					    LocationInterface startingLocationNum = (LocationInterface) Naming.lookup(rmiAddress+"Location");
					    //startingLocationNum.getStationNum( per.getCurrentLocationNum());
					    LocationInterface endLocationNum = (LocationInterface) Naming.lookup(rmiAddress+"Location");
					    //endLocationNum.getStationNum(button_9.getButtonNum() );
					    SubwayInterface sub = (SubwayInterface) Naming.lookup(rmiAddress+"Subway");
					    //sub.distance(per.getPID(), startingLocationNum.getStationNum(per.getCurrentLocationNum()), endLocationNum.getStationNum(button_9.getButtonNum() ));
			            b = sub.ticketPrice(startingLocationNum.getStationNum(per.getCurrentLocationNum()), endLocationNum.getStationNum(button_9.getButtonNum() ));
			            c = sub.checkOut(per.getPID(), startingLocationNum.getStationNum(per.getCurrentLocationNum()), endLocationNum.getStationNum(button_9.getButtonNum() ));				  				    				    
				    }catch(RemoteException e4){
				    	e4.printStackTrace();
				    } catch (MalformedURLException e5) {
				    	// TODO Auto-generated catch block
				    	e5.printStackTrace();
				    } catch (NotBoundException e6) {
				    	// TODO Auto-generated catch block
				    	e6.printStackTrace();
				    }		
				    SubTicket subTicket=new SubTicket(a,b,c,d);
				    subTicket.setLocationRelativeTo(null);
			    	subTicket.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
			    	subTicket.setVisible(true);
				    dispose();
			    }
		    });
		}
		button_9.setBounds(532, 136, 94, 23);
		contentPanel.add(button_9);
			
		JButton button_cancel = new JButton("\u53D6\u6D88");
		button_cancel.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				SubEnter dialog = new SubEnter();
				dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
				dialog.setVisible(true);
				dispose();
			}
		});
		button_cancel.setBounds(552, 329, 86, 23);
		contentPanel.add(button_cancel);
		
		JLabel label = new JLabel("\u4E00\u53F7\u7EBF");
		label.setFont(new Font("华文琥珀", Font.PLAIN, 20));
		label.setForeground(new Color(34, 139, 34));
		label.setBounds(22, 228, 77, 32);
		contentPanel.add(label);
		
		JLabel label_1 = new JLabel("\u4E8C\u53F7\u7EBF");
		label_1.setForeground(new Color(128, 0, 128));
		label_1.setFont(new Font("华文琥珀", Font.PLAIN, 20));
		label_1.setBounds(22, 278, 77, 32);
		contentPanel.add(label_1);
		
		JLabel label_2 = new JLabel("本站：");
		label_2.setForeground(new Color(0, 0, 255));
		label_2.setFont(new Font("微软雅黑", Font.BOLD, 20));
		label_2.setBounds(22, 48, 120, 32);
		contentPanel.add(label_2);		
		
		try{
		    Configuration config=new Configuration();
	        String rmiAddress=config.getRmiAddress();
	        LocationInterface currentLocationName = (LocationInterface) Naming.lookup(rmiAddress+"Location");
	        e = currentLocationName.getName( per.getCurrentLocationNum());
		 }catch(RemoteException e4){
		    	e4.printStackTrace();
		    } catch (MalformedURLException e5) {
		    	// TODO Auto-generated catch block
		    	e5.printStackTrace();
		    } catch (NotBoundException e6) {
		    	// TODO Auto-generated catch block
		    	e6.printStackTrace();
		    }
		JLabel lblNewLabel = new JLabel(e+"");
		lblNewLabel.setForeground(new Color(0, 0, 255));
		lblNewLabel.setFont(new Font("微软雅黑", Font.BOLD, 20));
		lblNewLabel.setBounds(86, 48, 140, 32);
		contentPanel.add(lblNewLabel);		
		//D:/eclipse/virtual city/VirtualCity/
		ImageIcon im = new ImageIcon("src/client/images/ditietu.png");
	    JLabel  l1 = new JLabel(im);
	    l1.setBounds(0,0, 647, 374);
	    contentPanel.add(l1);
		
		
	}
	
}
